import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"
import { IsNotEmpty, IsNumber, IsString } from "class-validator"

export class RegisterInfoDTO {
    @ApiProperty()
    @IsNotEmpty({message: '用户名不能为空'})
    readonly accountname: string
    @ApiProperty()
    @IsNotEmpty({message: '真实名字不能为空'})
    @IsString({message: '真实名字必须是字符串'})
    readonly realname: string
    @ApiProperty()
    @IsNotEmpty({message: '密码不能为空'})
    readonly password: string
    @ApiProperty()
    @IsNotEmpty({message: '重复密码不能为空'})
    readonly repassword: string
    @ApiProperty()
    @IsNotEmpty({message: '手机号不能为空'})
    @IsNumber()
    readonly mobile: number
    @ApiPropertyOptional({
        required: false,
        description: '[用户角色]: 0-超级管理员 | 1-管理员 | 2-开发&测试&运营 | 3-普通用户（只能查看）',
    })
    readonly role?: number | string
}